﻿using System;
using System.Windows.Forms;
using System.Resources;
using EnvDTE;

namespace VsTortoiseSVN.OptionPages
{
    public partial class IntegrationPage : PageBase
    {
        public IntegrationPage()
        {
            InitializeComponent();
        }

        #region IDTToolsOptionsPage Implementation
        public override void OnAfterCreated(DTE DTEObject)
        {
            base.OnAfterCreated(DTEObject);

            mainMenuToggle.Checked = Options.Instance.Integration.MainMenu;
            codeWindowToggle.Checked = Options.Instance.Integration.CodeWindow;
            documentWindowToggle.Checked = Options.Instance.Integration.DocumentWindow;
            solutionExplorerToggle.Checked = Options.Instance.Integration.SolutionExplorer;
        }

        public override void OnOK()
        {
            base.OnOK();

            Options.Instance.Integration.MainMenu = mainMenuToggle.Checked;
            Options.Instance.Integration.CodeWindow = codeWindowToggle.Checked;
            Options.Instance.Integration.DocumentWindow = documentWindowToggle.Checked;
            Options.Instance.Integration.SolutionExplorer = solutionExplorerToggle.Checked;

            Options.Instance.Save();
        }
        #endregion
    }
}
